class PartnersController < ApplicationController

	def new
		@partner = Partner.new
	end

	def create
		@partner = Partner.create(params[:partner])
		if @partner.save
			redirect_to :action => "index"
			flash[:notice] = "Partner Created $blue"		
		end	
	end

	def index
		@partners = Partner.all
	end

	def destroy
		@partner = Partner.find(params[:id])

		if @partner.destroy
			flash[:notice] = "Partner Deleted $blue"
			redirect_to(:action =>  "index")
		end
	end

	def edit
		@partner = Partner.find(params[:id])
	end

	def update
		@partner = Partner.find(params[:id])
		if @partner.update_attributes(params[:partner])
			redirect_to(:action => "index" , :notice => "User Saved Succesfully")
		else
			render("edit", :notice => "Couldn't save user")
		end
	end

end
